﻿using System;
using System.Drawing;
using System.Runtime.InteropServices;
using OutlookContactsSync.Domain.Globals;
using OutlookContactsSync.Domain.Repository;

namespace OutlookContactsSync.Repository
{
    public abstract class BaseRepository : IGlobalRepository
    {
        #region IGlobalRepository Members

        public event EventHandler<ProgressEventArgs> ReportProgress;

        #endregion

        public void ReportProgressBack(int currentAmountOfWorkItems, int currentItem, [Optional] Image picture)
        {
            if (ReportProgress != null)
            {
                ReportProgress(this, new ProgressEventArgs
                                         {
                                             CurrentAmountOfWorkItems = currentAmountOfWorkItems,
                                             CurrentItem = currentItem,
                                             Picture = picture
                                         });
            }
        }
    }
}